package com.google.code.qsecurity.shared;

import java.util.List;

import com.google.code.qsecurity.server.QService;
import com.google.code.qsecurity.server.QServiceLocator;
import com.google.code.qsecurity.shared.proxy.PasswordRequestProxy;
import com.google.code.qsecurity.shared.proxy.EmailVerificationProxy;
import com.google.code.qsecurity.shared.proxy.UserProxy;
import com.google.code.qsecurity.shared.proxy.response.QLoginResponseProxy;
import com.google.code.qsecurity.shared.proxy.response.QPasswordChangeResponseProxy;
import com.google.code.qsecurity.shared.proxy.response.QResponseProxy;
import com.google.code.qsecurity.shared.proxy.response.QSignupResponseProxy;
import com.google.code.qsecurity.shared.proxy.response.QVerificationResponseProxy;
import com.google.web.bindery.requestfactory.shared.ExtraTypes;
import com.google.web.bindery.requestfactory.shared.Request;
import com.google.web.bindery.requestfactory.shared.RequestContext;
import com.google.web.bindery.requestfactory.shared.Service;

@ExtraTypes(value = { QResponseProxy.class })
@Service(value = QService.class, locator = QServiceLocator.class)
public interface QRequest extends RequestContext {

	Request<UserProxy> readUser(String email);

	Request<QResponseProxy> updateUser(String oldEmail, UserProxy user);

	Request<Void> deleteUser(UserProxy user);

	Request<List<UserProxy>> queryUsers();
	
	Request<Boolean> isUserLoggedIn(String email);
	
	Request<QSignupResponseProxy> signup(String adminAddress, String appName, UserProxy user);
	
	Request<QLoginResponseProxy> login(UserProxy user);
	
	Request<Void> logout(String email);
	
	Request<QVerificationResponseProxy> verifySignupEmail(EmailVerificationProxy verification);

	Request<QPasswordChangeResponseProxy> processPasswordRequest(String adminAddress, String appName, String email);
	
	Request<QResponseProxy> verifyPasswordChangeLink(PasswordRequestProxy request);
	
}
